package com.lvyq.myplayer.ui.fragment

import android.content.Intent
import com.lvyq.myplayer.adapter.VBangAdapter
import com.lvyq.myplayer.base.BaseListAdapter
import com.lvyq.myplayer.base.BaseListFragment
import com.lvyq.myplayer.base.BaseListPresenter
import com.lvyq.myplayer.model.vbang.VBangBean
import com.lvyq.myplayer.parcelable.SongInfoData
import com.lvyq.myplayer.presenter.impl.VBangPresenterImpl
import com.lvyq.myplayer.widget.common.song.SongItemOperationView

/**
 * 文件描述：HomeFragment
 * 作者：lvyq
 * 创建时间：2025-02-13
 * 修改时间：2025-02-13
 */
class UserFragment: BaseListFragment<VBangBean, SongInfoData, SongItemOperationView>() {
    override fun getSpecialAdapter(): BaseListAdapter<SongInfoData, SongItemOperationView> {
        return VBangAdapter()
    }

    override fun getSpecialPresenter(): BaseListPresenter {
        return VBangPresenterImpl(this)
    }

    override fun getList(response: VBangBean): List<SongInfoData> {
        return response.rows
    }

    override fun initListener() {
        super.initListener()
        //点击监听
        adapter.setMyListener {
           myToast(it.id.toString())
            //跳转"
            var intent = Intent(context, com.lvyq.myplayer.ui.activity.AudioPlayerActivity::class.java)
             intent.putExtra("data",it)
            intent.putExtra("position",0)
            var musicLst=ArrayList<SongInfoData>()
            musicLst.add(it)
            intent.putParcelableArrayListExtra("songLst",musicLst)
            //查询传递对应的歌单集合
            startActivity(intent)
        }
    }




}